<tal:block metal:define-macro="standard">

  <form id="config" name="lizenz" method="post" action="${getPath}${getURL}/save">
    <table>
      <tr style="background-color:#e3e3e3; font-weight: bold;">
        <td colspan="2">
          ${text/inventory_hardware_info | NULL}
          <div style="float:right;">
            <button type="submit" aria-label="Left Align" title="${text/inventory_hardware_new_save | NULL}" class="btn btn-default glyphicon glyphicon-ok" aria-hidden="true" />
            <a type="button" aria-label="Left Align" title="${text/system_cancel | NULL}" class="btn btn-default glyphicon glyphicon-remove" aria-hidden="true" href="javascript:history.back();" />
          </div>
        </td>
      </tr>

      <tr>
        <td style="width:25%;">${text/inventory_hardware_designation | NULL}</td>
        <td style="width:75%;"><input type="text" name="bezeichnung" id="contactEmail" class="form-control" value="${detail/hardware/0/bezeichnung | NULL}" placeholder="${text/inventory_hardware_if_empty | NULL}" /></td>
      </tr>

      <tr>
        <td>${text/inventory_hardware_manufacturer | NULL}</td>
        <td><input type="text" name="hersteller" id="contactEmail" class="form-control" value="${detail/hardware/0/hersteller | NULL}" placeholder="${text/inventory_hardware_placeholder | NULL}" /></td>
      </tr>

      <tr>
        <td>${text/inventory_hardware_model | NULL}</td>
        <td><input type="text" name="modell" value="${detail/hardware/0/modell | NULL}" class="form-control" placeholder="${text/inventory_hardware_model | NULL}" /></td>
      </tr>

      <tr>
        <td>${text/inventory_hardware_category | NULL}</td>
        <td>
          <select class="form-control" name="kategorie" size="1">
            <option tal:condition="detail | NULL" tal:repeat="cat hardware_kategorie" value="${cat/key | NULL}" tal:attributes="selected php:detail['hardware']['0']['kategorie'] == cat['key']">${cat/val | NULL}</option>
            <option tal:condition="not:detail | NULL" tal:repeat="cat hardware_kategorie" value="${cat/key | NULL}">${cat/val | NULL}</option>
          </select>
        </td>
      </tr>

      <tr style="background-color:#e3e3e3; font-weight: bold;">
        <td colspan="2">${text/inventory_hardware_new_details | NULL}</td>
      </tr>

      <tr>
        <td>${text/inventory_hardware_inventorynumber | NULL}</td>
        <td><input type="text" name="inventarnummer" value="${detail/hardware/0/inventarnummer | NULL}" class="form-control" /></td>
      </tr>

      <tr>
        <td>${text/inventory_hardware_new_serial_numbe | NULL}</td>
        <td><input type="text" name="seriennummer" value="${detail/hardware/0/seriennummer | NULL}" class="form-control" /></td>
      </tr>

      <tr>
        <td>${text/inventory_hardware_date_purchase | NULL}</td>
        <td><input type="text" name="kaufdatum" class="tcal form-control" value="${detail/hardware/0/kaufdatum | NULL}" /></td>
      </tr>

      <tr>
        <td>${text/inventory_hardware_assignment | NULL}</td>
        <td><input type="text" name="zuordnung" value="${detail/hardware/0/zuordnung | NULL}" class="form-control" placeholder="${text/inventory_hardware_where | NULL}"/></td>
      </tr>

      <tr style="background-color:#e3e3e3; font-weight: bold;">
        <td colspan="2">${text/inventory_hardware_description | NULL}</td>
      </tr>

      <tr>
        <td colspan="2"><textarea name="beschreibung" class="form-control" id="contactComment">${detail/hardware/0/beschreibung | NULL}</textarea></td>
      </tr>  
    </table>

    <table>
      <tr style="background-color:#e3e3e3; font-weight: bold;">
        <td>
          ${text/inventory_hardware_more | NULL}
          <a type="button" aria-label="Left Align" class="btn btn-default glyphicon glyphicon-plus" aria-hidden="true" style="float:right;cursor:pointer;" onclick="insertInputFieldName('${text/structur_metatags_placeholder | NULL}');insertInputFieldValue('${text/structure_metatags_value | NULL}');" />
        </td>
      </tr>
    </table>

    <table tal:condition="detail/detail | NULL" tal:repeat="details detail/detail">
      <tr id="${details/id | NULL}">
        <td style="width:25%;"><input type="text" id="name_${details/id | NULL}" name="detail_name[]" value="${details/form_name | NULL}" class="form-control" /></td>
        <td style="width:70%;"><input type="text" id="value_${details/id | NULL}" name="detail_value[]" value="${details/form_value | NULL}" class="form-control" /></td>
        <td style="width:5%;"><a type="button" aria-label="Left Align" class="btn btn-default glyphicon glyphicon-remove" aria-hidden="true" style="cursor:pointer;float:right;" onclick="removeField('${details/id | NULL}'); document.getElementById('${details/id | NULL}').style.display = 'none';" /></td>
      </tr>
    </table>

    <table>
      <tr>
        <td style="width:25%;"><fieldset id="name"></fieldset></td>
        <td style="width:70%;"><fieldset id="value"></fieldset></td>
        <td style="width:5%;float:right;"></td>
        <td></td>
      </tr>
    </table>
  </form>

</tal:block>